<template>
  <button
    class="button"
    :class="[type ? 'jiang-button--' + type : '']"
    @click="sendClick"
  >
    <slot>就这?</slot>
  </button>
</template>
<script>
export default {
  props: {
    type: String,
    default: "primary",
  },
  name: "jiang-button",
  data() {
    return {};
  },
  created() {},
  methods: {
    sendClick(e) {
      this.$emit("click", e);
    },
  },
};
</script>
<style  scoped>
.button {
  height: 40px;
  width: auto;
  min-width: 100px;
  border-radius: 10px;
  outline: none;
  border: 1px solid #333;
  background-color: #fff;
  transition: background-color 0.4s;
  color: #000;
  box-sizing: border-box;
  padding: 0 15px;
  display: inline-block;
}
.button:hover {
  background-color: #eee;
  cursor: pointer;
  transition: background-color 0.4s;
}
.button:active {
  background-color: #ccc;
}
.jiang-button--primary {
  background-color: #48a2ff;
  color: #fff;
  border: none;
}
.jiang-button--success {
  background-color: #85ce61;
  color: #fff;
  border: none;
}
.jiang-button--warring {
  background-color: #e6a23c;
  color: #fff;
  border: none;
}
</style>